<%@ Page language="c#" Codebehind="CategoryAdmin.aspx.cs" AutoEventWireup="True" Inherits="Adge.Web.Faq.Admin.CategoryAdmin" %>
<%@ Register TagPrefix="skm" Namespace="FAQControls" Assembly="FAQControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>skmFAQs.NET :: Category Administration</title>
		<LINK href="../FAQstyle.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			<skm:LoginPanel id="LoginPanel1" Cssclass="faq_logout" runat="server"></skm:LoginPanel>
			<h1>Category Administration</h1>			
			<div class="faq_breadcrumb"><A href="Default.aspx">skmFAQs.NET Administration</A> &gt; 
				Category Administration</div>
			<P><asp:validationsummary id="ValidationSummary1" runat="server"></asp:validationsummary><asp:linkbutton id="lnkAddCategory" runat="server" CausesValidation="False" onclick="lnkAddCategory_Click">Add a New Category</asp:linkbutton></P>
			<P>
				<asp:Panel id="pnlEditCategoriesUI" runat="server">
					<asp:Repeater id="rptCategories" runat="server">
						<HeaderTemplate>
							<table class="faq_infoTable" cellspacing="0" cellpadding="5">
								<tr>
									<th>
										Category</th>
									<th>
										&nbsp;</th>
									<th>
										&nbsp;</th>
									<th>
										&nbsp;</th>
								</tr>
						</HeaderTemplate>
						<ItemTemplate>
							<%# PickTRColor(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "GroupID").ToString())) %>
							<td>
								<%# Adge.UI.WebControls.DGHelpers.DisplayDepth(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "Depth").ToString())) %>
								<%# DataBinder.Eval(Container.DataItem, "Name") %>
							</td>
							<td>
								<asp:ImageButton ID="btnMoveUp" Runat="server" CommandName="MoveUp" ImageUrl="~/Images/up.gif"></asp:ImageButton>
								<asp:ImageButton Runat="server" CommandName="MoveDown" ImageUrl="~/Images/down.gif" ID="btnMoveDown"></asp:ImageButton>
							</td>
							<td>
								<a href='EditCategory.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'">
									Edit</a>
							</td>
							<td>
								<asp:LinkButton CommandName="Delete" Runat="server" ID="btnDeleteCategory">Delete</asp:LinkButton>
							</td>
							</tr>
						</ItemTemplate>
						<FooterTemplate>
							</table>
						</FooterTemplate>
					</asp:Repeater>
				</asp:Panel></P>
			<asp:panel id="pnlCreateCategoryUI" runat="server" Visible="False">
<TABLE border="0">
					<TBODY>
  <TR>
							<TD align="right"><STRONG>Name:</STRONG></TD>
							<TD align="left"><asp:TextBox id="nameAdd" runat="server" MaxLength="100"></asp:TextBox>
								<asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ErrorMessage="You must enter a name for the category."
									Display="Dynamic" ControlToValidate="nameAdd">*</asp:RequiredFieldValidator></TD>
						</TR>
  <TR>
							<TD vAlign="top" align="right"><STRONG>Description:</STRONG></TD>
							<TD align="left">
								<asp:TextBox id="descriptionAdd" runat="server" MaxLength="1000" TextMode="MultiLine" Columns="40"
									Rows="4"></asp:TextBox></TD>
						</TR>
  <TR>
							<TD vAlign="top" align="right" height="11"><STRONG>Parent Category:</STRONG></TD>
							<TD align="left" height="11">
								<asp:Repeater id="rptCategoriesAdd" runat="server">
									<HeaderTemplate>
										<table class="faq_infoTable" cellpadding="3">
									</HeaderTemplate>
									<ItemTemplate>
										<%# PickTRColor(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "GroupID").ToString())) %>
										<td>
											<%# Adge.UI.WebControls.DGHelpers.DisplayDepth(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "Depth").ToString())) %>
											<%# DisplayRadioButton(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "CategoryID").ToString()), FAQComponents.Globals.NULLIntegerValue) %>
											<%# DataBinder.Eval(Container.DataItem, "Name") %>
										</td>
						</TR>
						</ItemTemplate>
						<FooterTemplate>
				</TABLE>
									</FooterTemplate>
								</asp:Repeater></TD></TR>
  <TR>
					<TD align="center" colSpan="2">
						<asp:Button id="btnAddCategory" runat="server" Text="Create Category" onclick="btnAddCategory_Click"></asp:Button>&nbsp;&nbsp;
						<asp:Button id="btnCancel" runat="server" CausesValidation="False" Text="Cancel" onclick="btnCancel_Click"></asp:Button></TD>
				</TR></TBODY></TABLE>
			</asp:panel></form>
	</body>
</HTML>
